#include "selectServer.hpp"
#include "err.hpp"
#include <memory>

using namespace std;
using namespace select_ns;

static void Usage(const string proc)
{
    std::cerr << "Usage:\n\t" << proc << " port\n\n";
}

string transaction(const string &request)
{
    return request;
}

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }

    // std::unique_ptr<selectServer> svr(new selectServer(transaction,atoi(argv[0])));
    std::unique_ptr<selectServer> svr(new selectServer(transaction));
    svr->initServer();
    svr->start();

    return 0;
}